/**
 * Created by admin on 2017/9/22.
 */
define([
    "helpers/network",
    "helpers/util"
], function (Network, Util) {
    var statusOptions = [{id: 0, value: "已禁用"}, {id: 1, value: "已启用"}];

    function genStatusColumn(data) {
        return {
            id: "status", header: "状态",
            template: function (obj) {
                return data.filter(function (currentValue, index, arr) {
                    return obj.status === currentValue.id
                })[0].value
            }
        }
    }

    function genLastModifyTimeColumn() {
        return {
            id: "lastModifyTime", header: "最后修改时间", width: 130, template: function (obj) {
                return Util.getFormattedDateTime("yyyy-MM-dd hh:mm:ss", new Date(obj.data.lastModifyTime))
            }
        }
    }

    function genDateTimeColumn(key) {
        return {
            id: key, header: title, width: 130, template: function (obj) {
                return Util.getFormattedDateTime("yyyy-MM-dd hh:mm:ss", new Date(obj.data.lastModifyTime))
            }
        }
    }
    return {
        genStatusColumn: genStatusColumn,
        genLastModifyTimeColumn: genLastModifyTimeColumn,
        // genSaveButton: genSaveButton,
        // genSingleImgUploader: genSingleImgUploader
    }
});